package com.kaikeba.bean;

import java.sql.Timestamp;
import java.util.Objects;

public class Courier {
    private int id;
    private String courierName;
    private String courierPhone;
    private String number;
    private String password;
    private int expressSum;
    private Timestamp regTime;
    private Timestamp lastLoginTime;

    public Courier() {
    }

    public Courier(String courierName, String courierPhone, String number, String password) {
        this.courierName = courierName;
        this.courierPhone = courierPhone;
        this.number = number;
        this.password = password;
    }

    public Courier(int id, String courierName, String courierPhone, String number, String password, int expressSum, Timestamp regTime, Timestamp lastLoginTime) {
        this.id = id;
        this.courierName = courierName;
        this.courierPhone = courierPhone;
        this.number = number;
        this.password = password;
        this.expressSum = expressSum;
        this.regTime = regTime;
        this.lastLoginTime = lastLoginTime;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCourierName() {
        return courierName;
    }

    public void setCourierName(String courierName) {
        this.courierName = courierName;
    }

    public String getCourierPhone() {
        return courierPhone;
    }

    public void setCourierPhone(String courierPhone) {
        this.courierPhone = courierPhone;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getExpressSum() {
        return expressSum;
    }

    public void setExpressSum(int expressSum) {
        this.expressSum = expressSum;
    }

    public Timestamp getRegTime() {
        return regTime;
    }

    public void setRegTime(Timestamp regTime) {
        this.regTime = regTime;
    }

    public Timestamp getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Timestamp lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    @Override
    public String toString() {
        return "Courier{" +
                "id=" + id +
                ", courierName='" + courierName + '\'' +
                ", courierPhone='" + courierPhone + '\'' +
                ", number='" + number + '\'' +
                ", password='" + password + '\'' +
                ", expressSum=" + expressSum +
                ", regTime=" + regTime +
                ", lastLoginTime=" + lastLoginTime +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Courier courier = (Courier) o;
        return id == courier.id &&
                expressSum == courier.expressSum &&
                Objects.equals(courierName, courier.courierName) &&
                Objects.equals(courierPhone, courier.courierPhone) &&
                Objects.equals(number, courier.number) &&
                Objects.equals(password, courier.password) &&
                Objects.equals(regTime, courier.regTime) &&
                Objects.equals(lastLoginTime, courier.lastLoginTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, courierName, courierPhone, number, password, expressSum, regTime, lastLoginTime);
    }
}
